package com.redis.lock;

import redis.clients.jedis.Jedis;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @date 2020-09-22 下午5:02
 */
public class LockTest {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("10.2.32.104", 6379);
        RedisWithReentrantLock lock = new RedisWithReentrantLock(jedis);
        System.out.println(lock.lock("holder"));
        System.out.println(lock.lock("holder"));
        System.out.println(lock.unlock("holder"));
        System.out.println(lock.unlock("holder"));
    }
}
